"""
Projectname: Lesson 21. Palindrome
Author: Jakhongir Kakharov
Date: 11.07.2022
"""

WORDS = ['Aziza', 'Tut', 'мадам', 'топот', 'test', 'madam', 'word']

PALINDROMES = [] # Bo'sh ro'yxat. 

for word in WORDS: # Word WORDSni ichidagi har bir
# narsaga teng.    
    if word == word[::-1]: # Agar word orqachalab
# ishlasa ifni ichida ishlaydi.
        PALINDROMES.append(word) # palindromes ro'yxatiga.
# qo'shadi

PALINDROMES1 = [word for word in WORDS if word == word[::-1]]

print(PALINDROMES)
print(PALINDROMES1)

MY_STR = ['Око за око', 'А роза упала на лапу Азора', 'Около Миши молоко']
PALINDROMES = []
for word in MY_STR:
    W = word.replace(' ', '').lower()
    if W == W[::-1]:
        PALINDROMES.append(word)
print(PALINDROMES)

L = list(range(1, 10))
L2 = list('hello')

print(L, L2)

S = '-'.join(map(str, L))
S2 = ','.join(L2)

print(S)
print(S2)
